package com.blame.chatRobot.entity;

import lombok.Data;
import org.springframework.ai.chat.messages.Message;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何彦声
 * Date: 2025-08-30
 * Time:
 */

@Data
public class MessageVo {

    private String role;
    private String content;

    public MessageVo(Message message){
        switch (message.getMessageType()){
            case USER -> {this.role = "user"; break;}
            case ASSISTANT -> {this.role = "assistant"; break;}
            case SYSTEM -> {this.role = "system"; break;}
            case TOOL -> {this.role = "tool"; break;}
        }
        this.content = message.getText();
        }


}
